package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.DrgsAnalysis;
import com.dhcc.DRGsHosp.facade.dto.DrgsAnalysisDTO;
/**
 * 
 * @ClassName: DRGsAnalysisAssembler  
 * @Description ：病组结构分析   
 * @Date: 2018年1月26日
 * @Author fulianxia
 */
public class DrgsAnalysisAssembler {
	
	public static DrgsAnalysisDTO  toDTO(DrgsAnalysis  drgsAnalysis){
		if (drgsAnalysis == null) {
			return null;
		}
		DrgsAnalysisDTO drgsAnalysisDto  = new DrgsAnalysisDTO();
		drgsAnalysisDto.setDateFrom(drgsAnalysis.getDateFrom());	
		drgsAnalysisDto.setDateTo(drgsAnalysis.getDateTo());
		drgsAnalysisDto.setDepCode(drgsAnalysis.getDepCode());
		drgsAnalysisDto.setDepGroupCode(drgsAnalysis.getDepGroupCode());
		drgsAnalysisDto.setDrgCode(drgsAnalysis.getDrgCode());
		drgsAnalysisDto.setHospCode(drgsAnalysis.getHospCode());
		drgsAnalysisDto.setLastDateFrom(drgsAnalysis.getLastDateFrom());
		drgsAnalysisDto.setLastDateTo(drgsAnalysis.getLastDateTo());
		drgsAnalysisDto.setMonitorType(drgsAnalysis.getMonitorType());
		drgsAnalysisDto.setQueryType(drgsAnalysis.getQueryType());
		drgsAnalysisDto.setWardCode(drgsAnalysis.getWardCode());
		drgsAnalysisDto.setYearFromA(drgsAnalysis.getYearFromA());
		drgsAnalysisDto.setYearFromB(drgsAnalysis.getYearFromB());
		drgsAnalysisDto.setYearToA(drgsAnalysis.getYearToA());
		drgsAnalysisDto.setYearToB(drgsAnalysis.getYearToB());
		drgsAnalysisDto.setStdId(drgsAnalysis.getStdId());
		drgsAnalysisDto.setVerRegion(drgsAnalysis.getVerRegion());
		return drgsAnalysisDto;
	 }
	
	public static List<DrgsAnalysisDTO>  toDTOs(Collection<DrgsAnalysis>  drgsAnalysis){
		if (drgsAnalysis == null) {
			return null;
		}
		List<DrgsAnalysisDTO> drgsAnalysisDtos = new ArrayList<DrgsAnalysisDTO>();
		for (DrgsAnalysis each : drgsAnalysis) {
			drgsAnalysisDtos.add(toDTO(each));
		}
		return drgsAnalysisDtos;
	}
	
	 public static DrgsAnalysis  toEntity(DrgsAnalysisDTO  drgsAnalysisDTO){
	 	if (drgsAnalysisDTO == null) {
			return null;
		}
	 	DrgsAnalysis drgsAnalysis  = new DrgsAnalysis();
	 	drgsAnalysis.setDateFrom(drgsAnalysisDTO.getDateFrom());	
	 	drgsAnalysis.setDateTo(drgsAnalysisDTO.getDateTo());
		drgsAnalysis.setDepCode(drgsAnalysisDTO.getDepCode());
		drgsAnalysis.setDepGroupCode(drgsAnalysisDTO.getDepGroupCode());
		drgsAnalysis.setDrgCode(drgsAnalysisDTO.getDrgCode());
		drgsAnalysis.setHospCode(drgsAnalysisDTO.getHospCode());
		drgsAnalysis.setLastDateFrom(drgsAnalysisDTO.getLastDateFrom());
		drgsAnalysis.setLastDateTo(drgsAnalysisDTO.getLastDateTo());
		drgsAnalysis.setMonitorType(drgsAnalysisDTO.getMonitorType());
		drgsAnalysis.setQueryType(drgsAnalysisDTO.getQueryType());
		drgsAnalysis.setWardCode(drgsAnalysisDTO.getWardCode());
		drgsAnalysis.setYearFromA(drgsAnalysisDTO.getYearFromA());
		drgsAnalysis.setYearFromB(drgsAnalysisDTO.getYearFromB());
		drgsAnalysis.setYearToA(drgsAnalysisDTO.getYearToA());
		drgsAnalysis.setYearToB(drgsAnalysisDTO.getYearToB());
		drgsAnalysis.setStdId(drgsAnalysisDTO.getStdId());
		drgsAnalysis.setVerRegion(drgsAnalysisDTO.getVerRegion());
 	  	return drgsAnalysis;
	 }
	
	public static List<DrgsAnalysis> toEntities(Collection<DrgsAnalysisDTO> drgsAnalysisDTOs) {
		if (drgsAnalysisDTOs == null) {
			return null;
		}
		
		List<DrgsAnalysis> drgsAnalysis = new ArrayList<DrgsAnalysis>();
		for (DrgsAnalysisDTO each : drgsAnalysisDTOs) {
			drgsAnalysis.add(toEntity(each));
		}
		return drgsAnalysis;
	}
}
